﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Linq;

using $safeprojectname$.Binding;

namespace $safeprojectname$
{
    /// <summary>
    ///     Extensions available on every place of the framework.
    /// </summary>
    public static partial class Ext
    {
        public static IValueContainer ToContainer(this System.Web.Mvc.IValueProvider valueProvider)
        {
            return new MvcValueContainer(valueProvider);
        }
        public static IValueContainer ToContainer(this System.Web.Http.ValueProviders.IValueProvider valueProvider)
        {
            return new ApiValueContainer(valueProvider);
        }
        public static System.Web.Mvc.IValueProvider ToProvider(this IValueContainer valueContainer)
        {
            var mvc = valueContainer as MvcValueContainer;

            return mvc.Is()
                ? mvc.ToValueProvider()
                : new ContainerToProvider(valueContainer);
        }
    }
}